package com.qw.gulimall.product.dao;

import com.qw.gulimall.product.entity.SkuInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

/**
 * sku??Ϣ
 * 
 * @author qw
 * @email 13793700519@163.com
 * @date 2022-03-17 19:06:08
 */
@Mapper
public interface SkuInfoDao extends BaseMapper<SkuInfoEntity> {

    @Select("SELECT weight FROM pms_spu_info WHERE id = (SELECT spu_id FROM pms_sku_info WHERE sku_id = ${skuId})")
    BigDecimal getWeightBySkuId(@Param("skuId") Long skuId);

}
